home *** CD-ROM | disk | FTP | other *** search
/ Sacred & Secular / Sacred and Secular.iso / pc / movies / shared.dir / 05027_Script_5027 < prev    next >
Text File  |  1996-04-03  |  3KB  |  140 lines

  1. on setQTVol n, chan
  2.   if voidP(chan) then set chan = 48
  3.   
  4.   if isQTPlaying(chan) then
  5.     set the volume of sprite chan = n
  6.   end if
  7. end
  8.  
  9. on isQTPlaying chan
  10.   if voidP(chan) then set chan = 48
  11.   
  12.   if the type of sprite chan = 16 and the castNum of sprite chan <> 0 then 
  13.     if the puppet of sprite chan then
  14.       if the stopTime of sprite chan > the movieTime of sprite chan then
  15.         return 1
  16.       end if
  17.     end if  
  18.   end if
  19.   
  20.   return 0
  21. end
  22.  
  23. on isOrWasQTPlaying chan
  24.   if voidP(chan) then set chan = 48
  25.   
  26.   if the type of sprite chan = 16 and the castNum of sprite chan <> 0 then 
  27.     if the puppet of sprite chan then
  28.       return 1
  29.     end if
  30.   end if  
  31.   
  32.   return 0
  33. end
  34.  
  35. on getgQTCastNum chan
  36.   if voidP(chan) then set chan = 48
  37.   
  38.   if the type of sprite chan = 16 and the castNum of sprite chan <> 0 then 
  39.     if the puppet of sprite chan then
  40.       return the castNum of sprite chan
  41.     end if
  42.   end if  
  43.   
  44.   return 0
  45. end
  46.  
  47. on getgQTNum chan
  48.   if voidP(chan) then set chan = 48
  49.   
  50.   set cn = getgQTCastNum(chan)
  51.   if cn = 0 then return -1
  52.   
  53.   set n = the fileName of cast cn
  54.   set l = length(n)
  55.   
  56.   return integer(char (l-5) to (l-4) of n)
  57. end
  58.  
  59.  
  60. on stopQTSound 
  61.   --put ">>> stopQTSound"
  62.   
  63.   if isOrWasQTPlaying() then
  64.     set the movierate of sprite 48 = 0
  65.     set the castNum of sprite 48 = 0
  66.     puppetSprite 48, 0
  67.     --updateStage
  68.   end if
  69. end stopQTSound
  70.  
  71. on pauseQTSound 
  72.   global gQTPause, gQTName, gQTCastNum
  73.   
  74.   --put ">>> pauseQTSound"
  75.   
  76.   if isQTPlaying() then
  77.     --put ">>> qt was paused"
  78.     set gQTPause = the movieTime of sprite 48
  79.     set the movierate of sprite 48 = 0
  80.     set gQTName = the fileName of cast gQTCastNum
  81.     set the castNum of sprite 48 = 0
  82.     --updateStage
  83.   else 
  84.     set gQTPause = -1  
  85.   end if
  86. end pauseQTSound
  87.  
  88. on unPauseQTSound 
  89.   
  90.   global gQTPause, gQTName, gQTCastNum, gVolume
  91.   
  92.   --put ">>> unPauseQTSound"
  93.   
  94.   if gQTName = the fileName of cast gQTCastNum and gQTPause <> -1 then
  95.     
  96.     --put ">>> qt was unpaused at " & gQTPause
  97.     
  98.     puppetSprite 48,1
  99.     set the type of sprite 48 = 16
  100.     set the castNum of sprite 48 = gQTCastNum
  101.     updateStage
  102.     
  103.     set the movieTime of sprite 48 = gQTPause
  104.     setQTVol(gVolume)  
  105.     set the movierate of sprite 48 = 1
  106.     --updateStage
  107.     set gQTPause = -1  
  108.     return 1
  109.   end if
  110.   
  111.   set gQTPause = -1  
  112.   return 0
  113. end unPauseQTSound
  114.  
  115.  
  116. on playQTSound sndFileName
  117.   global gQTCastNum, gVolume  
  118.   
  119.   puppetSprite 48,1
  120.   
  121.   set gQTCastNum = 4863 -- the number of cast "TEMPLATE.MOV"
  122.   
  123.   set the fileName of cast gQTCastNum = sndFileName
  124.   
  125.   --
  126.   --
  127.   -- Check to see if we are really UNPAUSING...
  128.   --
  129.   if unPauseQTSound() then exit
  130.   
  131.   set the castNum of sprite 48 = gQTCastNum
  132.   set the type of sprite 48 = 16
  133.   updateStage
  134.   
  135.   setQTVol(gVolume)  
  136.   set the movieRate of sprite 48 = 1
  137.   
  138. end
  139.  
  140.